import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  // 测试页面
  {
    path: '/',
    name: 'Layout',
    component: () => import('./components/layout/MainLayout.vue'),
    redirect: '/home',
    children: [
      { path: '/home', name: 'home', component: () => import('./views/index.vue') },
      { path: '/chat/:id', name: 'chat', component: () => import('./views/chat.vue') }
    ]
  }

  // 开发页面
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router